package com.example.ch4_1activity;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.widget.TextView;

import java.util.List;

public class ThridActivity extends AppCompatActivity {

    private TextView tvStu;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_thrid);

        tvStu = findViewById(R.id.tv_stu);
        //获取intent对象
        Intent intent = getIntent();
        //获取intent中的bundle对象
        Bundle bundle = intent.getBundleExtra("obj");
        //获取bundle中的数据
//        Student stu = (Student) bundle.getSerializable("stu");
        Student stu = (Student) bundle.getSerializable("stu");



        //显示数据到文本框中
        tvStu.setText(stu.toString());




    }
}